package com.huatai.dataservice.fire.firemodel;

import java.util.Arrays;

/**
 * @author gaowengui
 * 接警情况分布
 */
public enum AlarmDistributionEnum {
	SPECIAL_SERVICE_GROUP("特勤大队"),
	GUANSANFU_GROUP("观山湖大队"),
	NANMING_GROUP("南明大队"),
	HUAXI_GROUP("花溪大队"),
	YUNYAN_GROUP("云岩大队"),
	BAIYUN_GROUP("白云大队"),
	WUDANG_GROUP("乌当大队"),
	JINGKAI_GROUP("经开大队"),
	QINGZHENG_GROUP("清镇大队"),
	XIUWEN_GROUP("修文大队"),
	XIFENG_GROUP("息烽大队"),
	KAIYANG_GROUP("开阳大队");
	private final String displayName;

	AlarmDistributionEnum(String displayName) {
		this.displayName = displayName;
	}

	public static AlarmDistributionEnum fromDisplayName(String displayName) {
		return Arrays.stream(values())
			.filter(type -> type.getDisplayName().equals(displayName))
			.findFirst()
			.orElseThrow(() -> new IllegalArgumentException(
				"无效的救援类型名称: " + displayName +
					"，有效类型：" + Arrays.toString(values())
			));
	}

	public String getDisplayName() {
		return displayName;
	}
}
